package com.blueocean_health.care.management.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.blueocean_health.care.management.domain.base.Team;
import com.blueocean_health.care.management.domain.dto.TeamPayDto;
import com.blueocean_health.care.management.domain.vo.TeamPayVo;
import com.blueocean_health.care.management.mapper.TeamMapper;
import com.blueocean_health.care.management.service.ITeamService;
@Service
public class TeamServiceImpl implements ITeamService{
	@Autowired
	private TeamMapper teamMapper;
	@Override
	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public Boolean changeHosipital(TeamPayDto teamPayDto){
		return teamMapper.changeHosipital(teamPayDto);
     };
     @Override
     public TeamPayVo  selecthospitalworkerpay (String hosipital){
    	 Team selectByPrimaryKey = teamMapper.selectByPrimaryKey(Integer.valueOf(hosipital));
    	 TeamPayVo teamPayVo=new TeamPayVo();
    	 teamPayVo.setWorkerPayPattern(selectByPrimaryKey.getWorkerPayPattern());
    	 teamPayVo.setWorkerPayProportion(selectByPrimaryKey.getWorkerPayProportion());
		return teamPayVo;
    	 
     }
}
